<?php
	class nguoidungbs
	{
		// Các trường
		public $MaNguoiDung = 0; // auto_increment
		public $HoTen = "";
		public $DiaChi = "";
        public $TinhThanhPho = 0;
        public $Email = "";
        public $SoDienThoai = "";
        public $CongTy = "";
        public $TenDangNhap = "";
		public $MatKhau = "";
        public $MaXacNhan = "";
        public $Loai = 0;
        public $Khoa = 0;
		//public $QuyenHan = 0;
        
        //Phân trang
        public $SoNguoiDung = 6;
        public $P = 1;
		
		// Các phương thức
		public function add()
		{
			$db = new nguoidungdb();
			return $db->add($this->HoTen, $this->DiaChi, $this->TinhThanhPho, $this->Email, $this->SoDienThoai, $this->CongTy, $this->TenDangNhap, $this->MatKhau, $this->MaXacNhan, $this->Loai, $this->Khoa);
		}
		
		public function getList()
		{
			$db = new nguoidungdb();
			return $db->getList($this->MaNguoiDung, $this->TenDangNhap, $this->MatKhau);
		}
		
		public function delete()
		{
			$db = new nguoidungdb();
			return $db->delete($this->MaNguoiDung);
		}
		
		public function update()
		{
			$db = new nguoidungdb();
			return $db->update($this->MaNguoiDung ,$this->HoTen, $this->DiaChi, $this->Email, $this->TinhThanhPho, $this->SoDienThoai, $this->CongTy, $this->TenDangNhap, $this->MatKhau, $this->MaXacNhan, $this->Loai, $this->Khoa);
		}
        
        public function issetUser()
		{
			$db = new nguoidungdb();
			return $db->issetUser($this->MaNguoiDung, $this->TenDangNhap, $this->MatKhau);
		}
        
        public function InfoUser()
        {
            $db = new nguoidungdb();
			return $db->InfoUser($this->TenDangNhap);
        }
        
        public function TotalPage()
        {
            $db = new nguoidungdb();
			return $db->TotalPage($this->SoNguoiDung, $this->TenDangNhap);
        }
        
        public function Paging()
        {
            $db = new nguoidungdb();
			return $db->Paging($this->SoNguoiDung, $this->P, $this->TenDangNhap);
        }
	}
?>